+2004-07-19 Matthias Clasen <mclasen@redhat.com>
+
+ Make GtkCellView public, since people seem to have uses for it,
+ it is clean API and we were just conservative in not making it
+ public initially. At the same time, get rid of GtkCellViewMenuItem,
+ which doesn't have any function which can't be served by a
+ GtkMenuItem with a GtkCellView child.
+
+ * gtk/gtk.h: Include gtkcellview.h
+
+ * gtk/Makefile.am (gtk_public_h_sources):
+
+ * gtk/Makefile.am (gtk_private_h_sources):
+ (gtk_c_sources): Remove gtkcellviewmenuitem.[hc]
+ * gtk/gtkcombobox.c: Replace all uses of GtkCellViewMenuItem by
+ GtkMenuItem with a GtkCellView child.
+
+ * gtk/gtkcellviewmenuitem.[hc]: Removed.
+
2004-07-19 Matthias Clasen <mclasen@redhat.com>
Support inline autocompletion in entries (#135953)
+2004-07-19 Matthias Clasen <mclasen@redhat.com>
+
+ Make GtkCellView public, since people seem to have uses for it,
+ it is clean API and we were just conservative in not making it
+ public initially. At the same time, get rid of GtkCellViewMenuItem,
+ which doesn't have any function which can't be served by a
+ GtkMenuItem with a GtkCellView child.
+
+ * gtk/gtk.h: Include gtkcellview.h
+
+ * gtk/Makefile.am (gtk_public_h_sources):
+
+ * gtk/Makefile.am (gtk_private_h_sources):
+ (gtk_c_sources): Remove gtkcellviewmenuitem.[hc]
+ * gtk/gtkcombobox.c: Replace all uses of GtkCellViewMenuItem by
+ GtkMenuItem with a GtkCellView child.
+
+ * gtk/gtkcellviewmenuitem.[hc]: Removed.
+
2004-07-19 Matthias Clasen <mclasen@redhat.com>
Support inline autocompletion in entries (#135953)
+2004-07-19 Matthias Clasen <mclasen@redhat.com>
+
+ Make GtkCellView public, since people seem to have uses for it,
+ it is clean API and we were just conservative in not making it
+ public initially. At the same time, get rid of GtkCellViewMenuItem,
+ which doesn't have any function which can't be served by a
+ GtkMenuItem with a GtkCellView child.
+
+ * gtk/gtk.h: Include gtkcellview.h
+
+ * gtk/Makefile.am (gtk_public_h_sources):
+
+ * gtk/Makefile.am (gtk_private_h_sources):
+ (gtk_c_sources): Remove gtkcellviewmenuitem.[hc]
+ * gtk/gtkcombobox.c: Replace all uses of GtkCellViewMenuItem by
+ GtkMenuItem with a GtkCellView child.
+
+ * gtk/gtkcellviewmenuitem.[hc]: Removed.
+
2004-07-19 Matthias Clasen <mclasen@redhat.com>
Support inline autocompletion in entries (#135953)
+2004-07-19 Matthias Clasen <mclasen@redhat.com>
+
+ Make GtkCellView public, since people seem to have uses for it,
+ it is clean API and we were just conservative in not making it
+ public initially. At the same time, get rid of GtkCellViewMenuItem,
+ which doesn't have any function which can't be served by a
+ GtkMenuItem with a GtkCellView child.
+
+ * gtk/gtk.h: Include gtkcellview.h
+
+ * gtk/Makefile.am (gtk_public_h_sources):
+
+ * gtk/Makefile.am (gtk_private_h_sources):
+ (gtk_c_sources): Remove gtkcellviewmenuitem.[hc]
+ * gtk/gtkcombobox.c: Replace all uses of GtkCellViewMenuItem by
+ GtkMenuItem with a GtkCellView child.
+
+ * gtk/gtkcellviewmenuitem.[hc]: Removed.
+
2004-07-19 Matthias Clasen <mclasen@redhat.com>
Support inline autocompletion in entries (#135953)
gtkcellrendererprogress.h \
gtkcellrenderertext.h \
gtkcellrenderertoggle.h \
+ gtkcellview.h \
gtkcheckbutton.h \
gtkcheckmenuitem.h \
gtkclipboard.h \
# GTK+ header files that don't get installed
gtk_private_h_sources = \
gtkcellrendererseptext.h\
- gtkcellview.h \
- gtkcellviewmenuitem.h \
gtkentryprivate.h \
gtkfilechooserembed.h \
gtkfilechooserentry.h \
gtkcellrenderertext.c \
gtkcellrenderertoggle.c \
gtkcellview.c \
- gtkcellviewmenuitem.c \
gtkcheckbutton.c \
gtkcheckmenuitem.c \
gtkclipboard.c \
#include <gtk/gtkcellrendererprogress.h>
#include <gtk/gtkcellrenderertext.h>
#include <gtk/gtkcellrenderertoggle.h>
+#include <gtk/gtkcellview.h>
#include <gtk/gtkcheckbutton.h>
#include <gtk/gtkcheckmenuitem.h>
#include <gtk/gtkclipboard.h>
+++ /dev/null
-/* gtkcellviewmenuitem.c
- * Copyright (C) 2003 Kristian Rietveld <kris@gtk.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-#include "gtkcellviewmenuitem.h"
-#include "gtkcellview.h"
-
-struct _GtkCellViewMenuItemPrivate
-{
- GtkWidget *cell_view;
-};
-
-static void gtk_cell_view_menu_item_init (GtkCellViewMenuItem *item);
-static void gtk_cell_view_menu_item_class_init (GtkCellViewMenuItemClass *klass);
-
-
-#define GTK_CELL_VIEW_MENU_ITEM_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_CELL_VIEW_MENU_ITEM, GtkCellViewMenuItemPrivate))
-
-GType
-gtk_cell_view_menu_item_get_type (void)
-{
- static GType cell_view_menu_item_type = 0;
-
- if (!cell_view_menu_item_type)
- {
- static const GTypeInfo cell_view_menu_item_info =
- {
- sizeof (GtkCellViewMenuItemClass),
- NULL,
- NULL,
- (GClassInitFunc) gtk_cell_view_menu_item_class_init,
- NULL,
- NULL,
- sizeof (GtkCellViewMenuItem),
- 0,
- (GInstanceInitFunc) gtk_cell_view_menu_item_init
- };
-
- cell_view_menu_item_type =
- g_type_register_static (GTK_TYPE_MENU_ITEM, "GtkCellViewMenuItem",
- &cell_view_menu_item_info, 0);
- }
-
- return cell_view_menu_item_type;
-}
-
-static void
-gtk_cell_view_menu_item_class_init (GtkCellViewMenuItemClass *klass)
-{
- g_type_class_add_private ((GObjectClass *)klass,
- sizeof (GtkCellViewMenuItemPrivate));
-}
-
-static void
-gtk_cell_view_menu_item_init (GtkCellViewMenuItem *item)
-{
- item->priv = GTK_CELL_VIEW_MENU_ITEM_GET_PRIVATE (item);
-}
-
-GtkWidget *
-gtk_cell_view_menu_item_new (void)
-{
- GtkCellViewMenuItem *item;
-
- item = g_object_new (GTK_TYPE_CELL_VIEW_MENU_ITEM, NULL);
-
- item->priv->cell_view = gtk_cell_view_new ();
- gtk_container_add (GTK_CONTAINER (item), item->priv->cell_view);
- gtk_widget_show (item->priv->cell_view);
-
- return GTK_WIDGET (item);
-}
-
-GtkWidget *
-gtk_cell_view_menu_item_new_with_pixbuf (GdkPixbuf *pixbuf)
-{
- GtkCellViewMenuItem *item;
-
- item = g_object_new (GTK_TYPE_CELL_VIEW_MENU_ITEM, NULL);
-
- item->priv->cell_view = gtk_cell_view_new_with_pixbuf (pixbuf);
- gtk_container_add (GTK_CONTAINER (item), item->priv->cell_view);
- gtk_widget_show (item->priv->cell_view);
-
- return GTK_WIDGET (item);
-}
-
-GtkWidget *
-gtk_cell_view_menu_item_new_with_text (const gchar *text)
-{
- GtkCellViewMenuItem *item;
-
- item = g_object_new (GTK_TYPE_CELL_VIEW_MENU_ITEM, NULL);
-
- item->priv->cell_view = gtk_cell_view_new_with_text (text);
- gtk_container_add (GTK_CONTAINER (item), item->priv->cell_view);
- gtk_widget_show (item->priv->cell_view);
-
- return GTK_WIDGET (item);
-}
-
-GtkWidget *
-gtk_cell_view_menu_item_new_with_markup (const gchar *markup)
-{
- GtkCellViewMenuItem *item;
-
- item = g_object_new (GTK_TYPE_CELL_VIEW_MENU_ITEM, NULL);
-
- item->priv->cell_view = gtk_cell_view_new_with_markup (markup);
- gtk_container_add (GTK_CONTAINER (item), item->priv->cell_view);
- gtk_widget_show (item->priv->cell_view);
-
- return GTK_WIDGET (item);
-}
-
-GtkWidget *
-gtk_cell_view_menu_item_new_from_model (GtkTreeModel *model,
- GtkTreePath *path)
-{
- GtkCellViewMenuItem *item;
-
- item = g_object_new (GTK_TYPE_CELL_VIEW_MENU_ITEM, NULL);
-
- item->priv->cell_view = gtk_cell_view_new ();
- gtk_container_add (GTK_CONTAINER (item), item->priv->cell_view);
-
- gtk_cell_view_set_model (GTK_CELL_VIEW (item->priv->cell_view), model);
- gtk_cell_view_set_displayed_row (GTK_CELL_VIEW (item->priv->cell_view), path);
-
- gtk_widget_show (item->priv->cell_view);
-
- return GTK_WIDGET (item);
-}
+++ /dev/null
-/* gtkcellviewmenuitem.h
- * Copyright (C) 2003 Kristian Rietveld <kris@gtk.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef __GTK_CELL_VIEW_MENU_ITEM_H__
-#define __GTK_CELL_VIEW_MENU_ITEM_H__
-
-#include <gtk/gtkmenuitem.h>
-#include <gtk/gtktreemodel.h>
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_CELL_VIEW_MENU_ITEM (gtk_cell_view_menu_item_get_type ())
-#define GTK_CELL_VIEW_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CELL_VIEW_MENU_ITEM, GtkCellViewMenuItem))
-#define GTK_CELL_VIEW_MENU_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CELL_VIEW_MENU_ITEM, GtkCellViewMenuItemClass))
-#define GTK_IS_CELL_VIEW_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CELL_VIEW_MENU_ITEM))
-#define GTK_IS_CELL_VIEW_MENU_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CELL_VIEW_MENU_ITEM))
-#define GTK_CELL_VIEW_MENU_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CELL_VIEW_MENU_ITEM, GtkCellViewMenuItemClass))
-
-
-typedef struct _GtkCellViewMenuItem GtkCellViewMenuItem;
-typedef struct _GtkCellViewMenuItemClass GtkCellViewMenuItemClass;
-typedef struct _GtkCellViewMenuItemPrivate GtkCellViewMenuItemPrivate;
-
-struct _GtkCellViewMenuItem
-{
- GtkMenuItem parent_instance;
-
- /*< private >*/
- GtkCellViewMenuItemPrivate *priv;
-};
-
-struct _GtkCellViewMenuItemClass
-{
- GtkMenuItemClass parent_class;
-};
-
-
-GType gtk_cell_view_menu_item_get_type (void);
-GtkWidget *gtk_cell_view_menu_item_new (void);
-
-GtkWidget *gtk_cell_view_menu_item_new_with_pixbuf (GdkPixbuf *pixbuf);
-GtkWidget *gtk_cell_view_menu_item_new_with_text (const gchar *text);
-GtkWidget *gtk_cell_view_menu_item_new_with_markup (const gchar *markup);
-
-GtkWidget *gtk_cell_view_menu_item_new_from_model (GtkTreeModel *model,
- GtkTreePath *path);
-
-
-G_END_DECLS
-
-#endif /* __GTK_CELL_VIEW_MENU_ITEM_H__ */
#include "gtkcelllayout.h"
#include "gtkcellrenderertext.h"
#include "gtkcellview.h"
-#include "gtkcellviewmenuitem.h"
#include "gtkeventbox.h"
#include "gtkframe.h"
#include "gtkhbox.h"
GList *cells, *list;
gboolean sensitive;
- if (!GTK_IS_CELL_VIEW_MENU_ITEM (item))
+ if (!GTK_IS_CELL_VIEW (GTK_BIN (item)->child))
return FALSE;
cell_view = gtk_bin_get_child (GTK_BIN (item));
GtkWidget *item = GTK_WIDGET (child->data);
gboolean sensitive;
- if (!GTK_IS_CELL_VIEW_MENU_ITEM (item))
+ if (!GTK_IS_CELL_VIEW (GTK_BIN (item)->child))
continue;
sensitive = menu_row_is_sensitive (combo_box, item);
tmp = gtk_separator_menu_item_new ();
else
{
- tmp = gtk_cell_view_menu_item_new_from_model (combo_box->priv->model,
- path);
+ GtkCellView *cell_view;
+
+ cell_view = gtk_cell_view_new ();
+ gtk_cell_view_set_model (cell_view, combo_box->priv->model);
+ gtk_cell_view_set_displayed_row (cell_view, path);
+ gtk_widget_show (GTK_WIDGET (cell_view));
+
+ tmp = gtk_menu_item_new ();
+ gtk_container_add (GTK_CONTAINER (tmp), cell_view);
+
g_signal_connect (tmp, "activate",
G_CALLBACK (gtk_combo_box_menu_item_activate),
combo_box);
- cell_view_sync_cells (combo_box,
- GTK_CELL_VIEW (GTK_BIN (tmp)->child));
+ cell_view_sync_cells (combo_box, cell_view);
}
gtk_menu_shell_append (GTK_MENU_SHELL (menu), tmp);
GtkWidget *menu;
GtkWidget *item;
GtkComboBox *combo_box = GTK_COMBO_BOX (user_data);
+ GtkCellView *cell_view;
if (!combo_box->priv->popup_widget)
return;
menu = combo_box->priv->popup_widget;
g_return_if_fail (GTK_IS_MENU (menu));
- item = gtk_cell_view_menu_item_new_from_model (model, path);
+ cell_view = gtk_cell_view_new ();
+ gtk_cell_view_set_model (cell_view, model);
+ gtk_cell_view_set_displayed_row (cell_view, path);
+ gtk_widget_show (GTK_WIDGET (cell_view));
+
+ item = gtk_menu_item_new ();
+ gtk_container_add (GTK_CONTAINER (item), cell_view);
+
g_signal_connect (item, "activate",
G_CALLBACK (gtk_combo_box_menu_item_activate),
combo_box);
- cell_view_sync_cells (combo_box, GTK_CELL_VIEW (GTK_BIN (item)->child));
+ cell_view_sync_cells (combo_box, cell_view);
gtk_menu_shell_insert (GTK_MENU_SHELL (menu), item,
gtk_tree_path_get_indices (path)[0]);
if (GTK_IS_TEAROFF_MENU_ITEM (i->data))
continue;
- if (GTK_IS_CELL_VIEW_MENU_ITEM (i->data))
- view = GTK_CELL_VIEW (GTK_BIN (i->data)->child);
- else
- view = GTK_CELL_VIEW (i->data);
+ if (GTK_IS_CELL_VIEW (i->data))
+ view = GTK_CELL_VIEW (i->data);
+ else
+ view = GTK_CELL_VIEW (GTK_BIN (i->data)->child);
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (view), cell, expand);
}
if (GTK_IS_TEAROFF_MENU_ITEM (i->data))
continue;
- if (GTK_IS_CELL_VIEW_MENU_ITEM (i->data))
- view = GTK_CELL_VIEW (GTK_BIN (i->data)->child);
- else
+ if (GTK_IS_CELL_VIEW (i->data))
view = GTK_CELL_VIEW (i->data);
+ else
+ view = GTK_CELL_VIEW (GTK_BIN (i->data)->child);
gtk_cell_layout_pack_end (GTK_CELL_LAYOUT (view), cell, expand);
}
if (GTK_IS_TEAROFF_MENU_ITEM (i->data))
continue;
- if (GTK_IS_CELL_VIEW_MENU_ITEM (i->data))
- view = GTK_CELL_VIEW (GTK_BIN (i->data)->child);
- else
+ if (GTK_IS_CELL_VIEW (i->data))
view = GTK_CELL_VIEW (i->data);
+ else
+ view = GTK_CELL_VIEW (GTK_BIN (i->data)->child);
gtk_cell_layout_clear (GTK_CELL_LAYOUT (view));
}
if (GTK_IS_TEAROFF_MENU_ITEM (i->data))
continue;
- if (GTK_IS_CELL_VIEW_MENU_ITEM (i->data))
- view = GTK_CELL_VIEW (GTK_BIN (i->data)->child);
- else
+ if (GTK_IS_CELL_VIEW (i->data))
view = GTK_CELL_VIEW (i->data);
+ else
+ view = GTK_CELL_VIEW (GTK_BIN (i->data)->child);
gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (view), cell,
attribute, column);
if (GTK_IS_TEAROFF_MENU_ITEM (i->data))
continue;
- if (GTK_IS_CELL_VIEW_MENU_ITEM (i->data))
- view = GTK_CELL_VIEW (GTK_BIN (i->data)->child);
- else
+ if (GTK_IS_CELL_VIEW (i->data))
view = GTK_CELL_VIEW (i->data);
+ else
+ view = GTK_CELL_VIEW (GTK_BIN (i->data)->child);
gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (view), cell,
func, func_data, NULL);
if (GTK_IS_TEAROFF_MENU_ITEM (i->data))
continue;
- if (GTK_IS_CELL_VIEW_MENU_ITEM (i->data))
- view = GTK_CELL_VIEW (GTK_BIN (i->data)->child);
- else
+ if (GTK_IS_CELL_VIEW (i->data))
view = GTK_CELL_VIEW (i->data);
+ else
+ view = GTK_CELL_VIEW (GTK_BIN (i->data)->child);
gtk_cell_layout_clear_attributes (GTK_CELL_LAYOUT (view), cell);
}
if (GTK_IS_TEAROFF_MENU_ITEM (i->data))
continue;
- if (GTK_IS_CELL_VIEW_MENU_ITEM (i->data))
- view = GTK_CELL_VIEW (GTK_BIN (i->data)->child);
- else
+ if (GTK_IS_CELL_VIEW (i->data))
view = GTK_CELL_VIEW (i->data);
+ else
+ view = GTK_CELL_VIEW (GTK_BIN (i->data)->child);
gtk_cell_layout_reorder (GTK_CELL_LAYOUT (view), cell, position);
}
}
else if (event->keyval == GDK_Return)
{
- gtk_cell_editable_editing_done (GTK_CELL_EDITABLE (combo_box));
+ if (GTK_IS_CELL_EDITABLE (combo_box))
+ gtk_cell_editable_editing_done (GTK_CELL_EDITABLE (combo_box));
if (GTK_IS_CELL_EDITABLE (combo_box))
gtk_cell_editable_remove_widget (GTK_CELL_EDITABLE (combo_box));